package cn.scxy.bookcity.controller;

import cn.scxy.bookcity.ex.ServiceException;
import cn.scxy.bookcity.pojo.dto.AdminLoginDTO;
import cn.scxy.bookcity.pojo.dto.UserLoginDTO;
import cn.scxy.bookcity.pojo.vo.AddressListItemVO;
import cn.scxy.bookcity.service.IAdminLoginService;
import cn.scxy.bookcity.service.IUserLoginService;
import cn.scxy.bookcity.web.JsonResult;
import cn.scxy.bookcity.web.ServiceCode;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.util.List;

@RestController
@Slf4j
@Api(tags = "管理员登录")
@RequestMapping("/adminlogin")
public class AdminLoginController {
    @Autowired
    private IAdminLoginService service;
    @PostMapping("/login")
    public JsonResult<AdminLoginDTO> adminLogin(AdminLoginDTO adminLoginDTO, HttpServletResponse response, HttpSession session){
        AdminLoginDTO i= service.adminlogin(adminLoginDTO,response,session);
        return JsonResult.ok(i);
    }

}
